﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Taurus.Components;
using Taurus.Master.BLL;

namespace Taurus.Master
{
    class MasterComponent : Component
    {
        private MasterUI _ui = new MasterUI();

        public override string Name
        {
            get { return "大师"; }
        }

        public override string Version
        {
            get { return "1.0.0.0"; }
        }

        public override string Unique
        {
            get { return "CD2AF258-128B-4aba-A3BD-1732034F18E2"; }
        }

        public override System.Windows.Forms.UserControl GetUI()
        {
            return _ui;
        }

        protected override void Init()
        {
            InitSys.Instance.Init();
            foreach (var item in InitSys.Instance.MasterList)
            {
                item.StartPK += new EventHandler<PKEventArgs>(item_StartPK);
                item.EndPK += new EventHandler<PKEventArgs>(item_EndPK);
            }
        }

        void item_EndPK(object sender, PKEventArgs e)
        {
            SendMessage(string.Empty);
        }

        void item_StartPK(object sender, PKEventArgs e)
        {
            SendMessage(string.Format("开始与{0}PK", e.Pker.Name));
        }
    }
}
